﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using web_api.Models;

namespace web_api.Controllers
{
    public class RetrieveController : ApiController
    {
        //找回密码
        public  bool Post()
        {
            var username = HttpContext.Current.Request["username"];
            var oldpassword = HttpContext.Current.Request["oldpassword"];
            var newpassword = HttpContext.Current.Request["newpassword"];
            var secret = HttpContext.Current.Request["secret"];
            var answer = HttpContext.Current.Request["answer"];
            bool read=DBhelper.Retrieve(username, oldpassword, newpassword, secret, answer);
            if (read==true)
            {
                return true;
            }
            else
            {
                return  false;
            }
        


        }
    }
}
